{itemplate 'public/header'}
<link rel="stylesheet" href="../addons/we7_wmall/plugin/spread/static/css/index.css">
{if $op == 'index'}
<div class="page page-current">
	<header class="bar bar-nav common-bar-nav">
		<a href="javascript:;" class="pull-left back"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title">佣金明细</h1>
	</header>
	{itemplate 'nav'}
	<div class="content infinite-scroll js-infinite" data-href="{php echo imurl('spread/current/index')}" data-distance="50" data-min="{$min}" data-container=".list-block .list" data-tpl="tpl-current">
		<div class="buttons-tab activity_status">
			<a href="{php echo ifilter_url('trade_type: 0');}" class="button {if $trade_type == 0}active{/if}">全部</a>
			<a href="{php echo ifilter_url('trade_type: 1');}" class="button {if $trade_type == 1}active{/if}">佣金入账</a>
			<a href="{php echo ifilter_url('trade_type: 2');}" class="button {if $trade_type == 2}active{/if}">申请提现</a>
			<a href="{php echo ifilter_url('trade_type: 3');}" class="button {if $trade_type == 3}active{/if}">其他变动</a>
		</div>
		<div class="current-list">
			{if empty($current)}
			<div class="no-data">
				<div class="bg"></div>
				<p>暂时没有佣金明细哦～</p>
			</div>
			{else}
			<div class="list-block">
				<ul class="list">
					{loop $current $item}
					<li class="item-content item-link">
						<a href="{php echo imurl('spread/current/detail', array('id' => $item['id']))}">
							<div class="item-inner border-1px-b">
								<div class="item-title">
									<div class="item-title-top">
										{if $item['trade_type'] == 1}
										佣金入账
										{elseif $item['trade_type'] == 2}
										申请提现
										{elseif $item['trade_type'] == 3}
										其他变动
										{/if}
									</div>
									<div class="item-title-bottom">{$item['addtime']}</div>
								</div>
								<div class="item-after">
									{if $item['fee'] > 0}
										<div class="item-after-top color-success">
											+{$item['fee']}
										</div>
									{else}
										<div class="item-after-top color-danger">
											{$item['fee']}
										</div>
									{/if}
									<div class="item-after-bottom">¥{$item['amount']}</div>
								</div>
							</div>
						</a>
					</li>
					{/loop}
				</ul>
			</div>
			{/if}
		</div>
	</div>
</div>

<script id="tpl-current" type="text/html">
	<{# for(var i = 0, len = d.length; i < len; i++){ }>
	<li class="item-content item-link">
		<a href="{php echo imurl('spread/current/detail')}&id:<{d[i].id}>">
			<div class="item-inner border-1px-b">
				<div class="item-title">
					<div class="item-title-top">
						<{# if(d[i].trade_type == 1) {}>
						订单入账
						<{# } else if(d[i].trade_type == 2) {}>
						申请提现
						<{# } else if(d[i].trade_type == 3) {}>
						其他变动
						<{# } }>
					</div>
					<div class="item-title-bottom"><{d[i].addtime}></div>
				</div>
				<div class="item-after">
					<{# if(d[i].fee > 0) {}>
					<div class="item-after-top color-success">
						+<{d[i].fee}>
					</div>
					<{# } else { }>
					<div class="item-after-top color-danger">
						<{d[i].fee}>
					</div>
					<{# }}>
					<div class="item-after-bottom">¥<{d[i].amount}></div>
				</div>
			</div>
		</a>
	</li>
	<{# } }>
</script>
{/if}

{if $op == 'detail'}
	<div class="page page-current-detial">
		<header class="bar bar-nav common-bar-nav">
			<a href="javascript:;" class="pull-left back"><i class="icon icon-arrow-left"></i></a>
			<h1 class="title">佣金明细</h1>
		</header>
		<div class="content">
			<div class="wui-form-preview">
				<div class="wui-form-preview-hd">
					<label class="wui-form-preview-label">金额</label>
					<em class="wui-form-preview-value">
						{if $detail['fee'] > 0}
							+{$detail['fee']}
						{else}
							{$detail['fee']}
						{/if}
					</em>
				</div>
				<div class="wui-form-preview-bd">
					<div class="wui-form-preview-item">
						<label class="wui-form-preview-label">类型</label>
						<span class="wui-form-preview-value">
							{if $detail['trade_type'] == 1}
							订单入账
							{elseif $detail['trade_type'] == 2}
							申请提现
							{elseif $detail['trade_type'] == 3}
							其他变动
							{/if}
						</span>
					</div>
					<div class="wui-form-preview-item">
						<label class="wui-form-preview-label">申请时间</label>
						<span class="wui-form-preview-value">{php echo date('Y-m-d H:i', $detail['addtime'])}</span>
					</div>
					<div class="wui-form-preview-item">
						<label class="wui-form-preview-label">详细信息</label>
						<span class="wui-form-preview-value">{$detail['remark']}</span>
					</div>
				</div>
			</div>
		</div>

	</div>
{/if}
{itemplate 'public/footer'}